import $http from '@/assets/js/http'

//子账户列表
export function getUserList(token) {
    return $http.post('/app/user/child/list', {
        token: token,
    })
}

//新增子账户
export function addSubUser(param) {
    return $http.post('/app/user/child/add', {

        token: param.token,
        userName: param.userName,
        pwd: param.pwd,

    })
}
//重置子账户密码
export function resetSubUser(param) {
    return $http.post('/app/user/child/pwd', {
        token: param.token,
        childUserId: param.childUserId,
        newPwd: param.newPwd,
    })
}

//获得子账户详情 
export function getSubUserDetail(param) {
    return $http.post('/app/user/child/info', {
        token: param.token,
        childUserId: param.childUserId,
    })
}

//删除子账户 
export function deleteSubUser(param) {
    return $http.post('/app/user/child/delete', {
        token: param.token,
        childUserId: param.childUserId,
    })
}

//第一次登陆 录入信息 
export function postInputBaseInfo(param) {
    return $http.post('/app/user/addUserInfo', {
        token: param.token,
        realName: param.realName,
        mobile: param.mobile,
        province: param.province,
        city: param.city,
        district: param.district,
        address: param.address,
        category: param.category,
        staffNumber: param.staffNumber,
        factory: param.factory, //factory
    })
}

//第一次登陆 录入信息 
export function postQueryUserInfo(param) {
    return $http.post('/app/user/info', {
        token: param.token,
    })
}